package bankingSystemServer;

/**
 * Represents a user. Holds username and password.
 */
public class User {
	public String name;

	public String getName() {
		return name;
	}

	public String password;

	/**
	 * Creates a new User.
	 * 
	 * @param name
	 * @param password
	 */
	public User(String name, String password) {
		this.name = name;
		this.password = password;
	}

	/**
	 * Checks equality using name and password.
	 * 
	 * @param user
	 *            The user to match with.
	 * @return Returns true if user matches, false otherwise.
	 */
	public boolean equals(User user) {
		if (!user.name.equals(this.name)) {
			return false;
		}
		if (!user.password.equals(this.password)) {
			return false;
		}
		return true;
	}

	public String getPassword() {
		return password;
	}
}
